home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kbookmarkbar.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  3.4 KB  |  131 lines

  1. //  -*- c-basic-offset:4; indent-tabs-mode:nil -*-
  2. // vim: set ts=4 sts=4 sw=4 et:
  3. /* This file is part of the KDE project
  4.    Copyright (C) 1999 Kurt Granroth <granroth@kde.org>
  5.  
  6.    This library is free software; you can redistribute it and/or
  7.    modify it under the terms of the GNU Library General Public
  8.    License as published by the Free Software Foundation; either
  9.    version 2 of the License, or (at your option) any later version.
  10.  
  11.    This library is distributed in the hope that it will be useful,
  12.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.    Library General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU Library General Public License
  17.    along with this library; see the file COPYING.LIB.  If not, write to
  18.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  19.    Boston, MA 02110-1301, USA.
  20. */
  21. #ifndef KBOOKMARKBAR_H
  22. #define KBOOKMARKBAR_H
  23.  
  24. #include <qobject.h>
  25. #include <qguardedptr.h>
  26. #include <qptrlist.h>
  27. #include <kbookmark.h>
  28. #include <kaction.h>
  29.  
  30. class KToolBar;
  31. class KBookmarkMenu;
  32. class KBookmarkOwner;
  33. class KActionCollection;
  34. class KAction;
  35. class QPopupMenu;
  36.  
  37. /**
  38.  * This class provides a bookmark toolbar.  Using this class is nearly
  39.  * identical to using KBookmarkMenu so follow the directions
  40.  * there.
  41.  */
  42. class KIO_EXPORT KBookmarkBar : public QObject
  43. {
  44.     Q_OBJECT
  45.     friend class RMB;
  46. public:
  47.     /**
  48.      * Fills a bookmark toolbar
  49.      *
  50.      * @param manager the bookmark manager
  51.      * @param owner implementation of the KBookmarkOwner interface (callbacks)
  52.      * @param toolBar toolbar to fill
  53.      * 
  54.      * The KActionCollection pointer argument is now obsolete.
  55.      *
  56.      * @param parent the parent widget for the bookmark toolbar
  57.      * @param name the internal name for the bookmark toolbar
  58.      */
  59.     KBookmarkBar( KBookmarkManager* manager,
  60.                   KBookmarkOwner *owner, KToolBar *toolBar,
  61.                   KActionCollection *,
  62.                   QObject *parent = 0L, const char *name = 0L);
  63.  
  64.     virtual ~KBookmarkBar();
  65.  
  66.     /**
  67.      * @since 3.2
  68.      */
  69.     bool isReadOnly() const;
  70.  
  71.     /**
  72.      * @since 3.2
  73.      */
  74.     void setReadOnly(bool);
  75.  
  76.     /**
  77.      * @since 3.2
  78.      */
  79.     QString parentAddress();
  80.  
  81. signals:
  82.     /**
  83.      * @since 3.2
  84.      */
  85.     void aboutToShowContextMenu( const KBookmark &, QPopupMenu * );
  86.     /**
  87.      * @since 3.4
  88.      */
  89.     void openBookmark( const QString& url, Qt::ButtonState state );
  90.  
  91. public slots:
  92.     void clear();
  93.  
  94.     void slotBookmarksChanged( const QString & );
  95.     void slotBookmarkSelected();
  96.  
  97.     /**
  98.      * @since 3.4
  99.      */
  100.     void slotBookmarkSelected( KAction::ActivationReason reason, Qt::ButtonState state );
  101.     
  102.     /// @since 3.2
  103.     void slotRMBActionRemove( int );
  104.     /// @since 3.2
  105.     void slotRMBActionInsert( int );
  106.     /// @since 3.2
  107.     void slotRMBActionCopyLocation( int );
  108.     /// @since 3.2
  109.     void slotRMBActionEditAt( int );
  110.     /// @since 3.2
  111.     void slotRMBActionProperties( int );
  112.  
  113. protected:
  114.     void fillBookmarkBar( KBookmarkGroup & parent );
  115.     virtual bool eventFilter( QObject *o, QEvent *e );
  116.  
  117. private:
  118.     KBookmarkGroup getToolbar();
  119.  
  120.     KBookmarkOwner *m_pOwner;
  121.     QGuardedPtr<KToolBar> m_toolBar;
  122.     KActionCollection *m_actionCollection;
  123.     KBookmarkManager *m_pManager;
  124.     QPtrList<KBookmarkMenu> m_lstSubMenus;
  125.  
  126. private:
  127.     class KBookmarkBarPrivate* dptr() const;
  128. };
  129.  
  130. #endif // KBOOKMARKBAR_H
  131.